function projectedVectors=spreadGDA(T,L,dataGDA,sigma)
% Spread test vectors T into the GDA discriminant subspace.
% L is the learning vectors (like for buildGDA).
% dataGDA must be the output from buildGDA.
% T and L use line vectors

% Gaston Baudat & Fatiha Anouar / 21st October 2000 / Exton PA 19341 USA
% Designed under MatLab for Windows version 5.2.0.3084


n=length(T(:,1));	%size of the test set
m=length(L(:,1));	%size of the learning set

KernelEva=zeros(n,m);
Tep= gram(T,L,'gauss',sigma);
KernelEva=Tep-repmat(sum(Tep,2)/m,1,m);

inter=dataGDA.sumK-sum(dataGDA.sumK)/m;
KernelEva=KernelEva-repmat(inter,n,1);

projectedVectors=KernelEva*dataGDA.norAlpha;

